home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / catn / catch.n < prev    next >
Text File  |  1994-09-20  |  1KB  |  67 lines

  1.  
  2.  
  3.  
  4. catch(n)              Tcl Built-In Commands
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      catch - Evaluate script and trap exceptional returns
  12.  
  13. SYNOPSIS
  14.      catch _s_c_r_i_p_t ?_v_a_r_N_a_m_e?
  15. _________________________________________________________________
  16.  
  17.  
  18. DESCRIPTION
  19.      The catch command may be used to prevent errors from  abort-
  20.      ing command interpretation.  Catch calls the Tcl interpreter
  21.      recursively to execute _s_c_r_i_p_t, and always returns  a  TCL_OK
  22.      code,  regardless  of any errors that might occur while exe-
  23.      cuting _s_c_r_i_p_t.  The return value from  catch  is  a  decimal
  24.      string giving the code returned by the Tcl interpreter after
  25.      executing _s_c_r_i_p_t.  This will be 0 (TCL_OK) if there were  no
  26.      errors  in  _s_c_r_i_p_t;  otherwise it will have a non-zero value
  27.      corresponding to one of the exceptional  return  codes  (see
  28.      tcl.h  for  the definitions of code values).  If the _v_a_r_N_a_m_e
  29.      argument is given, then it gives the  name  of  a  variable;
  30.      catch  will  set  the  variable  to the string returned from
  31.      _s_c_r_i_p_t (either a result or an error message).
  32.  
  33.  
  34. KEYWORDS
  35.      catch, error
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.